<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <link rel="stylesheet" type="text/css" href="../../../global/css/aui.css" />
    <link rel="stylesheet" type="text/css" href="../../../global/css/swiper.min.css" />
    <link rel="stylesheet" type="text/css" href="./frm.css" />
</head>
<body>
	<div id="main" class="auix-popup">

	</div>
    <div class="aui-mask aui-mask-in">
		<div class="city-list-popup">
			<div class="popup-cover">
				<div class="popup-title">选择城市</div>
				<div id="close-btn" tapmode onclick="closePopup();" class="close-btn">
					<img src="../../../global/image/close-new.png" />
				</div>
			</div>

			<div class="city-list-popup-container">
				<div class="city-popup-top">
					<div class="popup-position border-bottom">
						<img class="position-icon" src="../../../global/image/position_blue.png" />
						<div tapmode onclick="selectPositionCity(this);" id="position-city" class="position-city"></div>
						<div id="position-desc" class="position-desc"></div>
					</div>
					<div class="hot-city">
						<div class="hot-city-title">热门城市</div>
						<div id="launch-city-list" class="hot-city-container"></div>
						<div id="hot-city-list" class="hot-city-container"></div>
					</div>
				</div>

				<div class="city-popup-selection">
					<div id="city-select-tab" class="select-tab border-bottom">
						<div class="blue-border-bottom">请选择</div>
					</div>
					<div id="city-select-list" class="select-list"></div>
				</div>
			</div>
		</div>
	</div>
</body>

<script id="tpl-tab-city-cell" type="text/x-dot-template">
	{{~it.hotCitys :v:i}}
	<div tapmode onclick="selectTabAction(this);" data-index="{{=i}}">{{=v.city}}</div>
	{{~}}
</script>

<script id="tpl-hot-city-cell" type="text/x-dot-template">
	{{~it.hotCitys :v:i}}
	<div tapmode onclick="selectHotCell(this);" data-gid="{{=v.gid}}">{{=v.city}}</div>
	{{~}}
</script>

<script id="tpl-city-select-cell" type="text/x-dot-template">
	{{~it.citys :v:i}}
	<div tapmode class="border-bottom" onclick="selectListAction(this);" data-pos="{{=JSON.stringify(v.treePath)}}" data-index="{{=i}}">{{=v.city}}</div>
	{{~}}
</script>

<!-- {{~x v:i}} 如果是多维数组，i必须不同，如用i,j,k等。-->
<script id="tpl-swiper-panel" type="text/x-dot-template">
	<div class="swiper-container">
	    <ul class="swiper-wrapper">
			{{~it :item:i}}
			<li class="swiper-slide col" data-id="{{=item.id}}" tapmode onclick="onAction(this);">
                {{? item.icon != ""}}
				    <img class="col-icon" src="{{=item.icon}}" />
                {{?}}
				<div class="col-name aui-grid-label">{{=item.name}}</div>
			</li>
			{{~}}
		</ul>
	</div>
</script>

<script type="text/javascript" src="../../../config.js"></script>
<script type="text/javascript" src="../../../global/script/lib/api.js"></script>
<script type="text/javascript" src="../../../global/script/lib/aui-toast.js"></script>
<script type="text/javascript" src="../../../global/script/lib/zepto.min.js"></script>
<script type="text/javascript" src="../../../global/script/lib/swiper.min.js"></script>
<script type="text/javascript" src="../../../global/script/lib/doT.min.js"></script>
<script type="text/javascript" src="../../../global/script/libx/myWxQQ.js"></script>
<script type="text/javascript" src="../../../global/script/libx/myAMapLoc.js"></script>
<script type="text/javascript" src="../../../global/script/mylib.js"></script>
<script type="text/javascript" src="../../../app.js"></script>
<script type="text/javascript" src="./frm.js"></script>

</html>

<script type="text/javascript" src="../../../global/script/_fakeApi.js"></script>

<script type="text/javascript">
    window.cityInfo = {
        "hotCitys": [],
        "citys": [
            {
                "id": 3,
                "city": "河北省",
                "alias": "河北",
                "level": 1,
                "gid": -1,
                "upid": 0,
                "is_mask": 0,
                "children": [
                    {
                        "id": 73,
                        "city": "石家庄市",
                        "alias": "石家庄",
                        "level": 2,
                        "gid": 73,
                        "upid": 3,
                        "is_mask": 1,
                        "children": [
                            {
                                "id": 1126,
                                "city": "井陉县",
                                "alias": "井陉",
                                "level": 3,
                                "gid": 1126,
                                "upid": 73,
                                "is_mask": 0,
                                "children": null
                            },
                            {
                                "id": 1128,
                                "city": "元氏县",
                                "alias": "元氏",
                                "level": 3,
                                "gid": 1128,
                                "upid": 73,
                                "is_mask": 0,
                                "children": null
                            },
                            {
                                "id": 1129,
                                "city": "平山县",
                                "alias": "平山",
                                "level": 3,
                                "gid": 1129,
                                "upid": 73,
                                "is_mask": 0,
                                "children": null
                            },
                            {
                                "id": 1130,
                                "city": "新乐市",
                                "alias": "新乐",
                                "level": 3,
                                "gid": 1130,
                                "upid": 73,
                                "is_mask": 0,
                                "children": null
                            }
                        ]
                    },
                    {
                        "id": 77,
                        "city": "邢台市",
                        "alias": "邢台",
                        "level": 2,
                        "gid": 77,
                        "upid": 3,
                        "is_mask": 1,
                        "children": [
                            {
                                "id": 1189,
                                "city": "临城县",
                                "alias": "临城",
                                "level": 3,
                                "gid": 1189,
                                "upid": 77,
                                "is_mask": 0,
                                "children": null
                            },
                            {
                                "id": 1190,
                                "city": "临西县",
                                "alias": "临西",
                                "level": 3,
                                "gid": 1190,
                                "upid": 77,
                                "is_mask": 0,
                                "children": null
                            },
                            {
                                "id": 1191,
                                "city": "任县",
                                "alias": "任县",
                                "level": 3,
                                "gid": 1191,
                                "upid": 77,
                                "is_mask": 0,
                                "children": null
                            },
                            {
                                "id": 1192,
                                "city": "内丘县",
                                "alias": "内丘",
                                "level": 3,
                                "gid": 1192,
                                "upid": 77,
                                "is_mask": 0,
                                "children": null
                            }
                        ]
                    },
                    {
                        "id": 81,
                        "city": "衡水市",
                        "alias": "衡水",
                        "level": 2,
                        "gid": 81,
                        "upid": 3,
                        "is_mask": 1,
                        "children": [
                            {
                                "id": 1261,
                                "city": "冀州市",
                                "alias": "冀州",
                                "level": 3,
                                "gid": 1261,
                                "upid": 81,
                                "is_mask": 0,
                                "children": null
                            },
                            {
                                "id": 1262,
                                "city": "安平县",
                                "alias": "安平",
                                "level": 3,
                                "gid": 1262,
                                "upid": 81,
                                "is_mask": 0,
                                "children": null
                            },
                            {
                                "id": 1263,
                                "city": "故城县",
                                "alias": "故城",
                                "level": 3,
                                "gid": 1263,
                                "upid": 81,
                                "is_mask": 0,
                                "children": null
                            },
                            {
                                "id": 1264,
                                "city": "景县",
                                "alias": "景县",
                                "level": 3,
                                "gid": 1264,
                                "upid": 81,
                                "is_mask": 0,
                                "children": null
                            }
                        ]
                    }
                ]
            },
            {
                "id": 4,
                "city": "山西省",
                "alias": "山西",
                "level": 1,
                "gid": -1,
                "upid": 0,
                "is_mask": 0,
                "children": [
                    {
                        "id": 90,
                        "city": "晋中市",
                        "alias": "晋中",
                        "level": 2,
                        "gid": 90,
                        "upid": 4,
                        "is_mask": 1,
                        "children": [
                            {
                                "id": 1349,
                                "city": "介休市",
                                "alias": "介休",
                                "level": 3,
                                "gid": 1349,
                                "upid": 90,
                                "is_mask": 0,
                                "children": null
                            },
                            {
                                "id": 1350,
                                "city": "和顺县",
                                "alias": "和顺",
                                "level": 3,
                                "gid": 1350,
                                "upid": 90,
                                "is_mask": 0,
                                "children": null
                            },
                            {
                                "id": 1351,
                                "city": "太谷县",
                                "alias": "太谷",
                                "level": 3,
                                "gid": 1351,
                                "upid": 90,
                                "is_mask": 0,
                                "children": null
                            },
                            {
                                "id": 1352,
                                "city": "寿阳县",
                                "alias": "寿阳",
                                "level": 3,
                                "gid": 1352,
                                "upid": 90,
                                "is_mask": 0,
                                "children": null
                            }
                        ]
                    },
                    {
                        "id": 91,
                        "city": "运城市",
                        "alias": "运城",
                        "level": 2,
                        "gid": 91,
                        "upid": 4,
                        "is_mask": 0,
                        "children": [
                            {
                                "id": 1366,
                                "city": "永济市",
                                "alias": "永济",
                                "level": 3,
                                "gid": 1366,
                                "upid": 91,
                                "is_mask": 0,
                                "children": null
                            },
                            {
                                "id": 1360,
                                "city": "万荣县",
                                "alias": "万荣",
                                "level": 3,
                                "gid": 1360,
                                "upid": 91,
                                "is_mask": 0,
                                "children": null
                            },
                            {
                                "id": 1367,
                                "city": "河津市",
                                "alias": "河津",
                                "level": 3,
                                "gid": 1367,
                                "upid": 91,
                                "is_mask": 0,
                                "children": null
                            },
                            {
                                "id": 1361,
                                "city": "临猗县",
                                "alias": "临猗",
                                "level": 3,
                                "gid": 1361,
                                "upid": 91,
                                "is_mask": 0,
                                "children": null
                            },
                            {
                                "id": 1371,
                                "city": "芮城县",
                                "alias": "芮城",
                                "level": 3,
                                "gid": 1371,
                                "upid": 91,
                                "is_mask": 0,
                                "children": null
                            },
                            {
                                "id": 1372,
                                "city": "闻喜县",
                                "alias": "闻喜",
                                "level": 3,
                                "gid": 1372,
                                "upid": 91,
                                "is_mask": 0,
                                "children": null
                            },
                            {
                                "id": 91,
                                "city": "运城市",
                                "alias": "运城",
                                "level": 2,
                                "gid": 91,
                                "upid": 4,
                                "is_mask": 0,
                                "children": null
                            }
                        ]
                    },
                ]
            },
        ],
    };
</script>


<script type="text/javascript">

    apiready();

    api.pageParam = {
        from: 'launch-set-city',
        launchGid: 1360,
        positionGid: 1366,
    };

    positionInfo = {
        addressComponent: {
            city:'市'
        }
    }

    renderCityInfo(cityInfo);

    markTreePath(cityInfo.citys);

    var gid = 1360;
    checkCityIsServiced(gid);
    renderPositionCity();

    // var lnglat =  {longitude: 116.44820773654514, latitude:39.971332465277776};
    // requestLocation(lnglat);

</script>
